#include "BaniSearch.h"
#include <QDebug>
#include <QStringList>
int BaniSearch::SearchModeAll = 0;
int BaniSearch::SearchModeFirstLetters = 1;
int BaniSearch::searchModePhrase = 2;
int BaniSearch::searchModeAny = 3;

BaniSearch::BaniSearch()
{
	qDebug() << "Trying";  
	db = QSqlDatabase::addDatabase("QSQLITE");
	db.setDatabaseName("akaal.db");
	db.open();
	qDebug() << "Is Open" << db.isOpen() << "Valid Driver" << db.isValid() ;
	qDebug() << "TABLES: " << db.tables();
	
}

BaniSearch::~BaniSearch()
{
}

void BaniSearch::search(QString query){
	qDebug() << "Trying to run query " << query;
	QSqlQuery query( QSqlDatabase::database() );
	query.exec(getSQLStatement()) ;
}

/**
 * Takes all the search criteria and builds a sql statement
 * to run returning the SQL string.
 * 
 * @return QString
 */
QString getSearchSQL(){
	return "SELECT * FROM Shabad";
}